/**
@file enumstostr.h
@brief Definition of the teplate function QTest::toString() for the MJN project enums.

This file contains implementation of the char* QTest::toString(const T& val) template function for the enums used in the MJN project. This template function is used by QCOMPARE macro of the QtTest unit testing framework to build human readable output.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 3 of the License.

@author VestniK (Sergey N.Vidyuk) sir.vestnik@gmail.com
@date 3 Jan 2009
*/
#include <QtCore/QByteArray>

#include "mjntypes.h"
#include "tile.h"

namespace QTest {

   template<>
   char *toString(const mjn::WindType& wind) {
      QByteArray res;
      switch( wind ){
         case mjn::East : res = "EastWind"; break;
         case mjn::South : res = "SouthWind"; break;
         case mjn::West : res = "WestWind"; break;
         case mjn::North : res = "NorthWind"; break;
      }
      return qstrdup(res.data());
   }

}
